export {};

class Person {
    public readonly name: string;
    private age: number;
    protected gender: boolean;
    constructor(name: string, age: number, gender: boolean) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }
    sayHi(msg: string):void {
        console.log(`i am ${this.name}, ${this.age}岁`)
    }
}


const person = new Person('aaa', 18, false);
console.log('person.name', person.name);
// 只读
// person.name = 'asd';